#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string>
#include <stdlib.h>

#include "linux_net.h"

using namespace std;
int main(int argc, char **argv)
{
 cout <<"Spusten klient."<<endl;
 Tsocket my_socket = Tsocket(DEFAULT_CLIENT_PORT);
 cout << "Pripojuju se na " << argv[1]<<endl;
 char *key_tmp=new char[20];
 int server_id=my_socket.connect_to(argv[1], DEFAULT_SERVER_PORT);
 for(;key_tmp[0]!='q';cin >> key_tmp) 
  my_socket.my_send(key_tmp, server_id);
 return 0;
}
